#include <sys/eventfd.h>
#include <unistd.h>
#include <cstdio>

int main(void)
{
    int efd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
    uint64_t example = 1;
    // printf("%ld\n", example);
    write(efd, &example, sizeof(example));
    // rintf("%ld\n", example);
    write(efd, &example, sizeof(example));
    // printf("%ld\n", example);
    uint64_t val = 0;
    read(efd, &val, sizeof(val));
    printf("%ld\n", val);
    close(efd);
    return 0;
}